package com.ln.store.dao;

import java.sql.SQLException;
import java.util.List;

import com.ln.store.domain.Product;

public interface ProductDao {
	
	/**
	 * 获取最新商品
	 * @return
	 * @throws SQLException 
	 */
	List<Product> findNews() throws SQLException;
	
	/**
	 * 获取热门商品
	 * @return
	 * @throws SQLException 
	 */
	List<Product> findHots() throws SQLException;
	
	/**
	 * 获取商品详情
	 * @param pid
	 * @return
	 * @throws SQLException
	 */
	Product findProductByPid(String pid) throws SQLException;
	
	/**
	 * 获取分类下的总的商品数量
	 * @param cid
	 * @return
	 */
	int findTotalRecord(String cid) throws SQLException;
	
	/**
	 * 获取分类下的商品列表
	 * @param cid
	 * @param startIndex
	 * @return
	 * @throws SQLException
	 */
	public List<Product> findProductsByCidWithPage(String cid, int startIndex,int PageSize) throws SQLException ;

}
